import request from '@/utils/request.js'
// console.log(request);
 
/**
 *  城市搜索
 */
export const citySerch = (data) => {
  return request({
    url: 'https://geoapi.qweather.com/v2/city/lookup?location='+data.location+'&key=cf183a62d0c7406f8f65e94e1a0a6652',
    method: 'get',
    params: data
  })
}
/**
 *  今日天气
 */
export const weatherNow = (data) => {
  return request({
    url: 'https://devapi.qweather.com/v7/weather/now?location='+data.location+'&key=cf183a62d0c7406f8f65e94e1a0a6652',
    method: 'get',
    params: data
  })
}
/**
 *  七天预报
 */
export const weatherSeven = (data) => {
  return request({
    url: 'https://devapi.qweather.com/v7/weather/7d?location='+data.location+'&key=cf183a62d0c7406f8f65e94e1a0a6652',
    method: 'get',
    params: data
  })
}

/**
 *  天气灾害预警
 */
export const warning = (data) => {
  return request({
    url: 'https://devapi.qweather.com/v7/warning/now?location='+data.location+'&key=cf183a62d0c7406f8f65e94e1a0a6652',
    method: 'get',
    params: data
  })
}
/**
 *  生活指数
 */
export const lifeData = (data) => {
  return request({
    url: 'https://devapi.qweather.com/v7/indices/1d?location='+data.location+'&key=cf183a62d0c7406f8f65e94e1a0a6652'+'&type=1,2,3,4,5,6,9,12,15,16',
    method: 'get',
    params: data
  })
}